home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / lzw4c13.zip / EXPAND.C < prev    next >
Text File  |  1993-08-29  |  903b  |  43 lines

  1. /*
  2. **  EXPAND.C      Copyright (C) 1992 by MarshallSoft Computing, Inc.
  3. **
  4. **  Expands file previously compressed with COMPRESS.
  5. **  Usage is:  EXPAND <input_file> <output_file>
  6. */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include "LZW4C.H"
  11. #include "RW_IO.H"
  12.  
  13. #define FALSE 0
  14. #define TRUE !FALSE
  15.  
  16. void main(argc,argv)
  17. int argc;
  18. char *argv[];
  19. {int RetCode;
  20.  /* begin */
  21.  if(argc<3)
  22.    {printf("Useage: EXPAND <infile> <outfile>\n");
  23.     exit(1);
  24.    }
  25.  if((RetCode=InitLZW(malloc,14))<0)
  26.    {SayError(RetCode);
  27.     exit(2);
  28.    }
  29.  /* open input file */
  30.  if(!ReaderOpen(argv[1])) exit(3);
  31.  /* open output file */
  32.  if(!WriterOpen(argv[2])) exit(4);
  33.  /* expand the compressed file */
  34.  printf("Expanding %s",argv[1]);
  35.  if((RetCode=Expand(Reader,Writer))<0)
  36.    {SayError(RetCode);
  37.     exit(3);
  38.    }
  39.  /* close files */
  40.  ReaderClose();
  41.  WriterClose();
  42.  TermLZW(free);
  43. }